package com.dd.ent.car.common.xrichtext.ui;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.dd.ent.car.R;
import com.dd.ent.car.common.bean.note.Note;

/**
 * Created by dengqu on 17/10/8.
 */

public class NoteHeaderView extends FrameLayout {
    private TextView texTitle;

    public NoteHeaderView(Context context) {
        super(context);
        init(context);
    }

    public NoteHeaderView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context);
    }

    private void init(Context context) {
        View root = LayoutInflater.from(context).inflate(R.layout.note_header_view, this, true);
        texTitle = (TextView) root.findViewById(R.id.tex_note_title);
    }

    public void refreshNote(Note note) {
        if (note != null) {
            texTitle.setText(note.getTitle());
        }
    }
}
